<?php
session_start();
if (!isset($_SESSION['login'])) {
    //não logado
    header("location:login.php");
}

$menu = $_GET["menu"];
if (isset($menu) AND !empty($menu)) {
    if ($menu == "sair") {
        unset($_SESSION['login']);
        unset($_SESSION['senha']);
        unset($_SESSION['departamento']);
        unset($_SESSION['administrador']);
        unset($_SESSION['gerente']);
        unset($_SESSION['agente']);

        header("location:login.php");
    }
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>CONTABIC - Principal</title>
        <style type="text/css">
            .atalho{border:solid; border-width:2px; border-color:#000}

        </style>
        <script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
        <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
        <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
        <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
        <style type="text/css">
            <!--
            body {
                background-image: url(images/servicos.gif);

                BACKGROUND-ATTACHMENT: FIXED;
                margin-left: 0px;
                margin-top: 0px;
                margin-right: 0px;
                margin-bottom: 0px;
            }
            -->
        </style></head>

    <body>
        <table width="1024" border="0" align="center">
            <tr>
                <td height="80" valign="top" bgcolor="#CCCCCC"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1024" height="80" id="FlashID" title="topo">
                        <param name="movie" value="animes/topo.swf" />
                        <param name="quality" value="high" />
                        <param name="wmode" value="opaque" />
                        <param name="swfversion" value="8.0.35.0" />
                        <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
                        <param name="expressinstall" value="Scripts/expressInstall.swf" />
                        <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
                        <!--[if !IE]>-->
                        <object type="application/x-shockwave-flash" data="animes/topo.swf" width="1024" height="80">
                            <!--<![endif]-->
                            <param name="quality" value="high" />
                            <param name="wmode" value="opaque" />
                            <param name="swfversion" value="8.0.35.0" />
                            <param name="expressinstall" value="Scripts/expressInstall.swf" />
                            <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
                            <div>
                                <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
                                <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
                            </div>
                            <!--[if !IE]>-->
                        </object>
                        <!--<![endif]-->
                    </object></td>
            </tr>
            <tr align="center">
                <td height="90" valign="top" bgcolor="#CCCCCC" >
                    <table height="90">
                        <tr>
                            <td class="atalho" width="120" align="center"><a href="?menu=movimentacao"><img src="images/btn1.jpg" width="120" height="90" /></a></td>
                            <td class="atalho" width="120" align="center"><a href="?menu=transferir"><img src="images/btn2.jpg" width="120" height="90" /></a></td>
                            <td class="atalho" width="120" align="center"><a href="?menu=previsao"><img src="images/btn3.jpg" width="120" height="90" /></a></td>
                            <td class="atalho" width="120" align="center"><a href="?menu=agrupar"><img src="images/btn4.jpg" width="120" height="90" /></a></td>
                            <td class="atalho" width="120" align="center"><a href="?menu=sair"><img src="images/sair.jpg" width="120" height="90" /></a></td>
                        </tr>
                    </table></td>
            </tr>
            <tr>
                <td height="37" valign="top" bgcolor="#CCCCCC" ><table align="center" width="910" height="40">
                        <tr>
                            <td width="902" height="34"><ul id="MenuBar1" class="MenuBarHorizontal">
                                    <li><a class="MenuBarItemSubmenu" href="#">Cadastrar</a>
                                        <ul>
                                            <li><a href="?menu=movimentacao">Movimentação</a></li>
                                            <li><a href="?menu=requisicao">Requisição</a></li>
                                            <li><a href="?menu=usuario">Usuário</a></li>
                                            <li><a href="?menu=departamento">Departamento</a></li>
                                        </ul>
                                    </li>
                                    <li><a href="#" class="MenuBarItemSubmenu">Visualizar</a>
                                        <ul>
                                            <li><a href="?menu=visualizar_requisicao">Requisi&ccedil;&atilde;o</a></li>
                                            <li><a href="?menu=visualizar_usuario">Usu&aacute;rio</a></li>
                                            <li><a href="?menu=visualizar_departamento">Departamento</a></li>
                                        </ul>
                                    </li>
                                    <li><a href="#" class="MenuBarItemSubmenu">Remover/Fechar</a>
                                        <ul>
                                            <li><a href="?menu=visualizar_usuario">Rem. usu&aacute;rio</a></li>
                                            <li><a href="?menu=visualizar_departamento">Fechar dpto.</a></li>
                                        </ul>
                                    </li>
                                    <li><a href="#" class="MenuBarItemSubmenu">Utilitários</a>
                                        <ul>
                                            <li><a href="?menu=transferir">Transferir saldo</a></li>
                                            <li><a href="?menu=previsao">Confirmar Previs&atilde;o</a></li>
                                            <li><a href="?menu=agrupar">Agrupar movimenta&ccedil;&atilde;o</a></li>
                                            <li><a href="#" class="MenuBarItemSubmenu">Atribuir</a>
                                                <ul>
                                                    <li><a href="?menu=atribuir">Gerente financeiro</a></li>
                                                    <li><a href="?menu=atribuir">Agente financeiro</a></li>
                                                </ul>
                                            </li>
                                        </ul>
                                    </li>
                                    <li><a class="MenuBarItemSubmenu" href="#">Alterar</a>
                                        <ul>
                                            <li><a href="#" class="MenuBarItemSubmenu">Usu&aacute;rio</a>
                                                <ul>
                                                    <li><a href="?menu=visualizar_usuario">Dados pessoais</a></li>
                                                    <li><a href="?menu=visualizar_usuario">Senha</a></li>
                                                </ul>
                                            </li>
                                            <li><a href="?menu=departamento">Departamento</a></li>
                                            <li><a href="?menu=categoria">Categoria</a></li>
                                        </ul>
                                    </li>
                                    <li><a href="#" class="MenuBarItemSubmenu">Relat&oacute;rios</a>
                                        <ul>
                                            <li><a href="?menu=relatorio">Movimenta&ccedil;&otilde;es</a></li>
                                            <li><a href="?menu=relatorio">Acessos</a></li>
                                            <li><a href="?menu=relatorio">Usu&aacute;rio por departamento</a></li>
                                            <li><a href="?menu=relatorio">Extrato de conta</a></li>
                                            <li><a href="?menu=relatorio">Conta</a></li>
                                        </ul>
                                    </li>
                                    <li><a href="#" class="MenuBarItemSubmenu">Ajuda</a>
                                        <ul>
                                            <li><a href="?menu=ajuda">Sobre</a></li>
                                        </ul>
                                    </li>

                                </ul></td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td height="720" valign="top" bgcolor="#CCCCCC" id="corpo">
                    <?php
                    $menu = $_GET["menu"];
                    if ($menu != "") {

                        include_once("pages/" . $menu . ".php");
                    }
                    ?>
                </td>
            </tr>
        </table>
        <script type="text/javascript">
            <!--
            swfobject.registerObject("FlashID");
            var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
            //-->
        </script>
    </body>
</html>